var express = require('express');
var router = express.Router();
const PositionService = require("../service/position-service.js");
const path = require("path");

const multer = require("multer");
const storage = multer.diskStorage({
	destination:function(req,file,cb){
		cb(null,path.join(__dirname,"../public/images/upload/"))
	},
	filename: function (req, file, cb) {
	    cb(null, file.fieldname + '-' + Date.now() + file.originalname.slice(file.originalname.lastIndexOf(".")))
	}
});
const upload = multer({storage:storage});
router.post("/add",upload.single("logo"),PositionService.add);
module.exports = router;
